[% setvar title C<\v> for Vertical Tab %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p><code>\v</code> for Vertical Tab</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Nicholas Clark &lt;<a href='mailto:nick@talking.bollo.cx'>nick@talking.bollo.cx</a>&gt;
  Date: 26 Sep 2000
  Last Modified: 30 Sep 2000
  Mailing List: <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a>
  Number: 327
  Version: 3
  Status: Frozen</pre>
<a name='CHANGES'></a><h1>CHANGES</h1>
<p>Reissued on <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a> - I goofed the list.
So far no comments on it.</p>
<p>Summarised discussion and changed status to frozen</p>
<a name='DISCUSSION'></a><h1>DISCUSSION</h1>
<p>Very little comment was made. Russ Allbery notes</p>
<pre>	The last time I used a vertical tab intentionally and for some
	productive purpose was about 1984.</pre>
<p>but states that this isn't an objection to the RFC.</p>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>perl5 includes all of C's escapes except <code>\v</code> (vertical tab). Treating
<code>\v</code> the same as <code>\a</code> <code>\b</code> <code>\e</code> <code>\f</code> <code>\h</code> <code>\r</code> <code>\t</code> would remove a
special case.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>man perl says:</p>
<pre>       Perl combines (in the author's opinion, anyway) some of
       the best features of C, sed, awk, and sh, so people
       familiar with those languages should have little
       difficulty with it. </pre>
<p>However, lack of <code>\v</code> represents a special case for a C programmer to
learn.  <code>\v</code> isn't used for anything else in double quoted strings, nor is
it used in regular expressions, so it won't require removal of an existing
feature to add it. Currently a <code>\v</code> in a double quoted strings will be
treated as <code>v</code>, with a warning about unknown escape issued if warnings are
in force.</p>
<p>Vertical tab was also omitted from the range of characters considered
whitespace by <code>\s</code> in regular expressions.</p>
<p>This RFC proposes</p>
<ul>
<li><a name='1'></a>1</li>
<p><code>\v</code> becomes a recognised escape for a vertical tab in interpolated
contexts (double quoted strings and regular expressions)</p>
<li><a name='2'></a>2</li>
<p>That vertical tab is moved from the <code>\S</code> (non-whitespace) to <code>\s</code>
(whitespace) class in regular expressions.</p>
</ul>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>Shouldn't be hard. Here are patches for perl 5.7.0</p>
<ul>
<li><a name='\v'></a><code>\v</code></li>
<pre>    --- toke.c.orig	Fri Sep 15 04:14:57 2000
    +++ toke.c	Tue Sep 26 12:54:30 2000
    @@ -469,7 +469,7 @@
     	for (t = s; !isSPACE(*t); t++) ;
     	e = t;
         }
    -    while (SPACE_OR_TAB(*e) || *e == '\r' || *e == '\f')
    +    while (SPACE_OR_TAB(*e) || *e == '\r' || *e == '\f' || *e == '\v')
     	e++;
         if (*e != '\n' &amp;&amp; *e != '\0')
     	return;		/* false alarm */
    @@ -1196,7 +1196,7 @@
     	: UTF;
         const char *leaveit =	/* set of acceptably-backslashed characters */
     	PL_lex_inpat
    -	    ? &quot;\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfeaxcz0123456789[{]} \t\n\r\f\v#&quot;
    +	    ? &quot;\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfveaxcz0123456789[{]} \t\n\r\f\v#&quot;
     	    : &quot;&quot;;
     
         while (s &lt; send || dorange) {
    @@ -1540,6 +1540,9 @@
     	    case 'f':
     		*d++ = '\f';
     		break;
    +	    case 'v':
    +		*d++ = '\v';
    +		break;
     	    case 't':
     		*d++ = '\t';
     		break;
    @@ -2700,7 +2703,7 @@
     	Perl_croak(aTHX_ 
           &quot;\t(Maybe you didn't strip carriage returns after a network transfer?)\n&quot;);
     #endif
    -    case ' ': case '\t': case '\f': case 013:
    +    case ' ': case '\t': case '\f': case '\v':
     #ifdef MACOS_TRADITIONAL
         case '\312':
     #endif
    --- t/op/pat.t.orig	Tue Aug 29 13:54:13 2000
    +++ t/op/pat.t	Tue Sep 26 12:56:36 2000
    @@ -469,27 +469,27 @@
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/i eq '(?i-xsm:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/i eq '(?i-xsm:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/s eq '(?s-xim:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/s eq '(?s-xim:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/m eq '(?m-xis:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/m eq '(?m-xis:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/x eq '(?x-ism:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/x eq '(?x-ism:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/xism eq '(?msix:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/xism eq '(?msix:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     
    -print &quot;not &quot; unless qr/\b\v$/ eq '(?-xism:\bv$)';
    +print &quot;not &quot; unless qr/\b\y$/ eq '(?-xism:\by$)';
     print &quot;ok $test\n&quot;;
     $test++;
     </pre>
<li><a name='\S to \s'></a><code>\S</code> to <code>\s</code></li>
<pre>    --- handy.h.orig	Thu Sep 14 15:44:20 2000
    +++ handy.h	Tue Sep 26 13:04:30 2000
    @@ -295,8 +295,9 @@
     #define isIDFIRST(c)	(isALPHA(c) || (c) == '_')
     #define isALPHA(c)	(isUPPER(c) || isLOWER(c))
     #define isSPACE(c) \
    -	((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f')
    -#define isPSXSPC(c)	(isSPACE(c) || (c) == '\v')
    +	((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f' \
    +	 || (c) == '\v')
    +#define isPSXSPC(c)	isSPACE(c)
     #define isBLANK(c)	((c) == ' ' || (c) == '\t')
     #define isDIGIT(c)	((c) &gt;= '0' &amp;&amp; (c) &lt;= '9')
     #ifdef EBCDIC
    --- t/op/pat.t.orig	Tue Aug 29 13:54:13 2000
    +++ t/op/pat.t	Tue Sep 26 14:27:14 2000
    @@ -1064,15 +1064,14 @@
     	      cr    =&gt; &quot;\r&quot;,
     	      lf    =&gt; &quot;\n&quot;,
     	      ff    =&gt; &quot;\f&quot;,
    -# The vertical tabulator seems miraculously be 12 both in ASCII and EBCDIC.
    -	      vt    =&gt; chr(11),
    +	      vt    =&gt; &quot;\v&quot;,
     	      false =&gt; &quot;space&quot; );
     
     my @space0 = sort grep { $space{$_} =~ /\s/ }          keys %space;
     my @space1 = sort grep { $space{$_} =~ /[[:space:]]/ } keys %space;
     my @space2 = sort grep { $space{$_} =~ /[[:blank:]]/ } keys %space;
     
    -print &quot;not &quot; unless &quot;@space0&quot; eq &quot;cr ff lf spc tab&quot;;
    +print &quot;not &quot; unless &quot;@space0&quot; eq &quot;cr ff lf spc tab vt&quot;;
     print &quot;ok $test\n&quot;;
     $test++;
     </pre>
</ul>
<p>To be strict the perl5 to perl6 converter would need to</p>
<ul>
<li><a name='replace \v with v in interpolated strings.'></a>replace <code>\v</code> with <code>v</code> in interpolated strings.</li>
<li><a name='replace \s with [\t\n\r\f ] and \S with [^\t\n\r\f ] in regular expressions.'></a>replace <code>\s</code> with <code>[\t\n\r\f ]</code> and <code>\S</code> with <code>[^\t\n\r\f ]</code> in regular
expressions.</li>
</ul>
<p>It might be considered acceptable to omit either or both conversions if the
number of programs that would break were negligible.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>perlop manpage for interpolation</p>
<p>perlre manpage for \s and \S</p>
</div>
